home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / mint / mgr / sparcmgr / src.zoo / src / border.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-03-17  |  1.6 KB  |  47 lines

  1. /*                        Copyright (c) 1987 Bellcore
  2.  *                            All Rights Reserved
  3.  *       Permission is granted to copy or use this program, EXCEPT that it
  4.  *       may not be sold for profit, the copyright notice must be reproduced
  5.  *       on copies, and credit should be given to Bellcore where it is due.
  6.  *       BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM.
  7.  */
  8. /*    $Header: border.c,v 1.1 89/03/17 08:20:52 sau Exp $
  9.     $Source: /m1/mgr.new/src/RCS/border.c,v $
  10. */
  11. static char    RCSid_[] = "$Source: /m1/mgr.new/src/RCS/border.c,v $$Revision: 1.1 $";
  12. /* draw a border around a window  */
  13.  
  14. #include "bitmap.h"
  15. #include "defs.h"
  16.  
  17. border(win,b,w)
  18. WINDOW  *win;            /* window */
  19. int b, w;            /* black width, white width */
  20.    {
  21.     register int clr,set;
  22.     register BITMAP *bdr;
  23.  
  24. #ifdef COLOR
  25.     clr = BIT_SRC | (W(background)&~NOCOLOR);
  26.     set = BIT_SRC ^ BIT_DST | (W(background)^W(style))&~NOCOLOR;
  27. #else
  28.    clr = BIT_CLR;
  29.    set = BIT_SET;
  30. #endif
  31.  
  32.     if (W(flags)&W_ACTIVE)
  33.         bdr = W(border);
  34.     else
  35.         bdr = W(save);
  36.  
  37.    bit_blit(bdr,0,0,BIT_WIDE(bdr),(b+w),clr,NULL_DATA,0,0);
  38.    bit_blit(bdr,BIT_WIDE(bdr)-(b+w),0,(b+w),BIT_HIGH(bdr),clr,NULL_DATA,0,0);
  39.    bit_blit(bdr,0,BIT_HIGH(bdr)-(b+w),BIT_WIDE(bdr),(b+w),clr,NULL_DATA,0,0);
  40.    bit_blit(bdr,0,0,(b+w),BIT_HIGH(bdr),clr,NULL_DATA,0,0);
  41.  
  42.    bit_blit(bdr,b,0,BIT_WIDE(bdr)-2*b,b,set,NULL_DATA,0,0);
  43.    bit_blit(bdr,BIT_WIDE(bdr)-b,0,b,BIT_HIGH(bdr),set,NULL_DATA,0,0);
  44.    bit_blit(bdr,b,BIT_HIGH(bdr)-b,BIT_WIDE(bdr)-2*b,b,set,NULL_DATA,0,0);
  45.    bit_blit(bdr,0,0,b,BIT_HIGH(bdr),set,NULL_DATA,0,0);
  46.    }
  47.